package com.yunxi.service.localService.impl.sto;

import com.github.pagehelper.PageInfo;
import com.yunxi.core.page.PageHelperPlus;
import com.yunxi.core.service.ServiceImplPlus;
import com.yunxi.dao.sto.StoStorageCheckMapper;
import com.yunxi.model.sto.StoStorageCheck;
import com.yunxi.service.localService.sto.StoStorageCheckService;
import com.yunxi.sto.pojo.*;
import org.springframework.stereotype.Service;
import java.util.List;

/**
 * <p>
 * 库存盘点 服务实现类
 * </p>
 *
 * @author caoYong
 * @since 2019-08-16
 */
@Service
public class StoStorageCheckServiceImpl extends ServiceImplPlus<StoStorageCheckMapper, StoStorageCheck> implements StoStorageCheckService {

    /**
     * 导出
     * @param stoStorageCheckVO
     * @return
     * @throws Exception
     */
    @Override
    public List<StoStorageCheckExportVO> export(StoStorageCheckVO stoStorageCheckVO) throws Exception {
        return baseMapper.export(stoStorageCheckVO);
    }

    /**
     * 通过库区代码查询在库车
     * @param stoStorageCheckAddVO
     * @return
     */
    @Override
    public List<String> queryInStockVin(StoStorageCheckAddVO stoStorageCheckAddVO) {
        return baseMapper.queryInStockVin(stoStorageCheckAddVO);
    }

    /**
     * 盘点计划列表
     * @param stoStorageCheckListVO
     * @return
     */
    @Override
    public PageInfo<StoStorageCheckListVO> checkPlanList(Integer pageNum,Integer pageSize,StoStorageCheckListVO stoStorageCheckListVO) {
        PageHelperPlus.startPage(pageNum,pageSize);
        List<StoStorageCheckListVO> list = baseMapper.checkPlanList(stoStorageCheckListVO);
        PageInfo<StoStorageCheckListVO> pageInfo = new PageInfo<>(list);
        return pageInfo;
    }

    /**
     * 根据VIN码查询盘点详情
     * @param stoStorageCheckVO
     * @return
     */
    @Override
    public StoStorageCheckDetailVO detail(StoStorageCheckVO stoStorageCheckVO) {
        return baseMapper.detail(stoStorageCheckVO);
    }

    /**
     * 盘点报告
     * @param checkName
     * @return
     * @throws Exception
     */
    @Override
    public StoStorageCheckReportVO checkReport(String checkName) throws Exception {
        return baseMapper.checkReport(checkName);
    }

    /**
     * 统计系统库存车辆数量
     * @param stoStorageCheckReportVO
     * @return
     */
    @Override
    public StoStorageCheckCountVO queryVehicleCount(StoStorageCheckReportVO stoStorageCheckReportVO) {
        return baseMapper.queryVehicleCount(stoStorageCheckReportVO);
    }
}
